//
//  RKConst.swift
//  RKTemplate
//
//  Created by zhaoke on 2023/7/23.
//

import Foundation
import UIKit

//
let RK_keyWindow = UIWindow.rk_KeyWindow()

//
var rk_screenWidth: CGFloat {
    guard let window = RK_keyWindow else {
        return UIScreen.main.bounds.width
    }
    return window.frame.size.width
}
var rk_screenHeight: CGFloat {
    guard let window = RK_keyWindow else {
        return UIScreen.main.bounds.height
    }
    return window.frame.size.height
}
var rk_safeAreaTop: CGFloat {
    guard let window = RK_keyWindow else {
        return 0
    }
    return window.safeAreaInsets.top
}
var rk_safeAreaBottom: CGFloat {
    guard let window = RK_keyWindow else {
        return 0
    }
    return window.safeAreaInsets.bottom
}
let kNaviBarHeight: CGFloat = 64
let kTabBarHeight: CGFloat = 49

//
var isIphoneX: Bool {
    guard let window = RK_keyWindow else {
        return false
    }
    if window.safeAreaInsets.left > 0 || window.safeAreaInsets.bottom > 0 {
        return true
    }
    return false
}
//
let HJFirstLaunch = "firstLaunchStr"
let isLogin = "isLogin"
